require '../lib/dotnet_compilers'

task :default => [:compile, :run, :clean]
task :save_out => [:compile, :run]
task :compile => [:compile_vb, :compile_cs, :compile_fs]

Compilers::DotNet::VbcTask.new(:compile_vb) do |t|
    t.inputs << "test.vb"
    t.target = "exe"
    t.debug = true
    t.out = "myvbtest.exe"
end

Compilers::DotNet::CscTask.new(:compile_cs) do |t|
    t.inputs << "test.cs"
    t.target = "exe"
    t.debug = true
    t.out = "mycstest.exe"
end

Compilers::DotNet::FscTask.new(:compile_fs) do |t|
    t.inputs << "test.fs"
    t.target = "exe"
    t.debug = true
    t.out = "myfstest.exe"
end

task :clean do
    Dir.glob("*.{exe,pdb}").each do |f|
        File.delete f
    end
end

task :run do
    puts `myvbtest` if File.exist? "myvbtest.exe"
    puts `mycstest` if File.exist? "mycstest.exe"
    puts `myfstest` if File.exist? "myfstest.exe"
end
